{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/zh_gjhdbm/template/public/ygcss.css">
<style type="text/css">
    .dizhi{margin-top: 10px;color: #44ABF7;}
    .yginp{width: 50%;}
    .ygspan{line-height: 35px;margin-left: 10px;}
    .form-group>label>b {
        color: red;
    }
</style>
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>
    <li ><a href="{php echo $this->createWebUrl('activity');}">案件管理</a></li>
    <li class="active"><a href="{php echo $this->createWebUrl('addactivity');}">添加案件</a></li>
</ul>
<div class="main ygmain">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                案件详情
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-sm-2 control-label must"><b>*</b>事故编号</label>
                    <div class="col-sm-9">
                        <input type="text"  name="event_num" class="form-control" placeholder="事故编号">
                    </div>
                </div>
                <div class="form-group show_contact">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label "><b>*</b>甲方信息</label>
                    <div class="contact_html">
                        <div class="col-lg-2">
                            <input type="text" class="form-control" name="tel[]"  placeholder="请填写联系电话"/>
                        </div>
                        <input type="hidden" class="form-control" name="type[]" />
                        <a href='javascript:void(0)' class='btn btn-info add_contact' >添加</a>
                        <a href='javascript:void(0)' class='btn btn-info del_attr' style="display: none" onclick="delContactAttr()">删除</a>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label "><b>*</b>指派交警</label>
                    <div class="col-sm-9">
                        <select class="form-control" name="deal_id">
                            <option value="0">请选择交警</option>
                            {loop $deal_data $deal}
                            <option value="{$deal['id']}">{$deal['user_name']}</option>
                            {/loop}
                        </select>
                    </div>
                </div>

                <!--<div class="form-group">-->
                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">处理状态</label>-->
                    <!--<div class="col-sm-9">-->
                        <!--<input type="text" readonly  class="form-control" value="{if $list['status'] == 0}未处理{elseif $list['status'] == 1}已通过{else}已拒绝{/if}" />-->
                    <!--</div>-->
                <!--</div>-->
            </div>
            <div class="form-group">
                <div class="col-sm-9" style="margin: 0 auto">
                    <input type="submit" name="add" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;" />
                    <input type="hidden" name="token" value="{$_W['token']}" />
                </div>
            </div>
        </div>
    </form>
</div>
<script>
    $(function() {
        $("#frame-8").show();
        $("#yframe-8").addClass("wyarticle");
    })
    var contact_index = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"];
    $(".add_contact").click(function() {
        var index = $('.show_contact').length;
        if(index==1){
            $(".del_attr").show();
        }
        //添加
        var html =  "<div class='form-group show_contact'><label class='col-xs-12 col-sm-3 col-md-2 control-label'>" + contact_index[index] +"方信息</label>  <div class='col-lg-2'> <input type='text' class='form-control' name='tel[]' placeholder='请填写联系电话'/> </div>  <input type='hidden' name='contact_ids[]' value=''/> <input type='hidden' name='type[]' value=''/></div> </div>";
        $(".show_contact:last").after(html);

    });
    //删除属性
    function delContactAttr(){
        $('.show_contact:last').remove();
    }
</script>
